package com.zsrt.java.day20161223.wrl.homework;

import org.junit.Test;

public class Work10 {
	
	/**
	 * 用while打印99乘法表，用都do while打印99乘法表
	 */
	@Test
	public void w10forWhile(){
		int index1 = 1;
		while(index1 <= 9){
			int index2 = 1;
			while(index2 <= index1){
				System.out.print(index1 + "x" + index2 + "=" + index1 * index2 + "\t");
				index2++;
			}
			System.out.println();
			index1++;
		}
	}

	@Test
	public void w10forDoWhile(){
		int index1 = 1;
		do{
			int index2 = 1;
			do{
				System.out.print(index2 + "x" + index1 + "=" + index1 * index2 + "\t");
				index2++;
			}while(index2 <= index1);
			System.out.println();
			index1++;
		}while(index1 <= 9);
	}
}
